using JGSY.CMS.LowCode.Platform.Domain.Entities;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace JGSY.CMS.LowCode.Platform.Domain.Interfaces
{
    /// <summary>
    /// 风险评估仓储接口
    /// 提供风险评估记录的数据访问操作，支持安全风险分析和用户行为评估功能
    /// </summary>
    public interface IRiskAssessmentRepository
    {
        /// <summary>
        /// 获取所有风险评估记录
        /// </summary>
        /// <returns>风险评估实体列表</returns>
        Task<IEnumerable<RiskAssessment>> GetAllAsync();
        
        /// <summary>
        /// 根据ID获取风险评估记录
        /// </summary>
        /// <param name="id">风险评估记录标识符</param>
        /// <returns>风险评估实体，如果未找到则返回null</returns>
        Task<RiskAssessment?> GetByIdAsync(long id);
        
        /// <summary>
        /// 根据用户ID获取风险评估记录
        /// </summary>
        /// <param name="userId">用户标识符</param>
        /// <returns>指定用户的风险评估实体列表</returns>
        Task<IEnumerable<RiskAssessment>> GetByUserIdAsync(long userId);
        
        /// <summary>
        /// 添加新的风险评估记录
        /// </summary>
        /// <param name="entity">要添加的风险评估实体</param>
        /// <returns>添加操作任务</returns>
        Task AddAsync(RiskAssessment entity);
        
        /// <summary>
        /// 更新风险评估记录
        /// </summary>
        /// <param name="id">风险评估记录标识符</param>
        /// <param name="entity">更新后的风险评估实体</param>
        /// <returns>更新操作任务</returns>
        Task UpdateAsync(long id, RiskAssessment entity);
        
        /// <summary>
        /// 删除风险评估记录
        /// </summary>
        /// <param name="id">风险评估记录标识符</param>
        /// <returns>删除操作任务</returns>
        Task DeleteAsync(long id);
    }
}
